﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Web.DynamicData;
using System.Web.Routing;

namespace MLM
{
    public class Global : HttpApplication
    {
        private static MetaModel s_defaultModel = new MetaModel();
        public static MetaModel DefaultModel
        {
            get
            {
                return s_defaultModel;
            }
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
           // routes.MapPageRoute("HomeEmptyQuery", "", "~/Home/Pages/Default.aspx");
            routes.MapPageRoute("Home", "Home.aspx", "~/Home/Pages/Default.aspx");
            routes.MapPageRoute("News", "News.aspx", "~/Home/Pages/News.aspx");
            routes.MapPageRoute("Shop", "Shop.aspx", "~/Home/Pages/Shop.aspx");
            routes.MapPageRoute("About", "About.aspx", "~/Home/Pages/About.aspx");
            routes.MapPageRoute("CheckOut", "Check-out.aspx", "~/Home/Pages/CheckOut.aspx");
            routes.MapPageRoute("ProductByCategory", "Products/{name}-{catid}.aspx", "~/Home/Pages/ProductsByCategory.aspx");
            routes.MapPageRoute("ProductDetail", "Product/{categoryname}/{name}-{id}.aspx", "~/Home/Pages/ProductDetail.aspx");
            routes.MapPageRoute("NewsDetail", "ReadNews/{name}-{id}.aspx", "~/Home/Pages/NewsDetail.aspx");
        }

        protected void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes(RouteTable.Routes);
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }

    }
}